<!--
 * @Author: your name
 * @Date: 2021-11-04 10:59:56
 * @LastEditTime: 2021-11-12 18:37:02
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \star-cat-h5\src\views\artist\components\TopSteps.vue
-->

<template>
  <div class="steps">
    <div v-for="(item, index) in steps" class="step" :key="index">
      <div :class="{ left_main: true, active: current >= item.val }">
        <img
          :src="require('@/assets/complete.png')"
          alt=""
          class="icon-img"
          v-if="current > item.val"
        />
        <img
          v-else
          class="icon-img"
          :src="require(`@/assets/${item.val + 1}_${current >= item.val?'active':'default'}.png`)"
          alt=""
        />
        <p>{{ item.title }}</p>
      </div>
      <div
        :class="{ right: true, active: current >= item.val + 1 }"
        v-if="index < steps.length - 1"
      >
        <div class="dian_box">
          <div
            class="dian"
            v-for="dianItem in 6"
            :key="dianItem + 'dian'"
          ></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    current: {
      default: 0,
    },
  },
  data() {
    return {
      steps: [
        { title: "艺人信息", val: 0 },
        { title: "主播信息", val: 1 },
        { title: "业务信息", val: 2 },
      ],
    };
  },
};
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
}
.steps {
  height: 76px;
  background-color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 45px;
  box-sizing: border-box;
  width: 100%;
}
.steps .step:not(:last-child) {
  display: flex;
  flex: 1;
}
.steps .step .left_main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.steps .step .left_main p {
  color: #8e95a9;
  font-size: 12px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  line-height: 16px;
  margin-top: 8px;
}
.steps .step .left_main .icon {
  font-size: 20px;
  font-family: Bahnschrift;
  color: #a3bffe;
  line-height: 24px;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border-radius: 100%;
  background-color: #f1f6ff;
  border: 2px solid #f1f6ff;
}
.steps .step .left_main .icon-img {
  width: 34px;
  height: 34px;
  border-radius: 100%;
}
.steps .step .right {
  flex: 1;
  margin-top: 18px;
  display: flex;
  justify-content: center;
}
.steps .step .right .dian_box {
  width: 33px;
  display: flex;
  justify-content: space-between;
}
.steps .step .right .dian {
  width: 3px;
  height: 3px;
  background-color: #8e95a9;
}
.steps .step .right.active .dian {
  background-color: #4c90fb;
}

/* 激活样式 */
.steps .step .left_main.active p {
  color: #4c90fb;
}

.steps .step .left_main.active .icon {
  color: #ffffff;
  background-color: #5792ff;
}
</style>